import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '@/views/index'
Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    component: index
  },
  {
    path: '/LookMapGo',
    name:'LookMapGo',
    component:()=>import('../views/LookMapGo/LookMapGo')
  },
  {
    path: '/CovInfoServe',
    name:'CovInfoServe',
    component: ()=>import('../views/CovInfoServe/CovInfoServe')
  },
  {
    path: '/jingdian',
    name: 'jingdian',
    component: () => import('../views/LookMapGo/JingdianView')
  },
  {
    path: '/watch/:id',
    name: 'watch',
    component: () => import('../views/LookMapGo/WatchView')
  },
  {
    path: '/wypl',
    name: 'wypl',
    component: () => import('../views/LookMapGo/WyplView')
  },
  {
    path: '/ckpl',
    name: 'ckpl',
    component: () => import('../views/LookMapGo/CkplView')
  },
  {
    path: '/hotelView',
    name: 'hotelView',
    component: () => import('../views/Hotels/hotelView')
  },
  {
    path: '/hotelpage/:hotel_id',
    name:'Hotelpage',
    component: ()=>import('../views/Hotels/hotelPage.vue')
  },
  {
    path: '/noticelist',
    name: 'noticelist',
    component: () => import('../views/CovInfoServe/noticeList')
  },
  {
    path: '/noticemore/:id',
    name: 'noticemore',
    component: () => import('../views/CovInfoServe/noticeMore')
  },
  {
    path: '/storeView',
    name: 'storeView',
    component: () => import('../views/Stores/storeView')
  },
  {
    path: '/medicine/:medicine_id/:medicine_id1',
    name: "Medicine",
    component: ()=>import('../views/Stores/MedicinePage.vue')
  },
  {

    path: '/suppermarket/:suppermarket_id/:suppermarket_id1',
    name:"Suppermarket",
    component: ()=>import('../views/Stores/SuppermarketPage.vue')
  },
  {
    path: '/storepage/:store_id',
    name: "StorePage",
    component: ()=>import('../views/Stores/StorePage.vue')
  },
  {
    path: '/writePj',
    name: 'writePj',
    component: () => import('../views/Stores/writePj')
  },
  {
    path: '/withUs',
    name: 'withUs',
    component: () => import('../views/PartInOur/withUs')
  },
  {
    path: '/shopping',
    name: 'shopping',
    component: () => import('../views/ShoppingView/shopping')
  },
  {
    path: '/enter',
    name:'enter',
    component: ()=>import('../views/Enter/enterView')
  },
  {
    path: '/login',
    name: 'login',
    component: ()=>import('../views/Login/loginView')
  },
  {
    path: '/problem',
    name: 'problem',
    component: ()=>import('../views/feedback/problem')
  }

]

const router = new VueRouter({
  routes
})

export default router

router.beforeEach((to, from, next) => {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
  window.pageYOffset = 0;
  next();
});

